﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Themes_Default_Home : System.Web.UI.MasterPage
{
    BankServices.BankingServices sv = new BankServices.BankingServices();
    protected void Page_Load(object sender, EventArgs e)
    {
        
        if (Session["AccountID"].Equals(""))
        {
            Response.Redirect("~/Login.aspx");
        }
        if (!IsPostBack)
        {
            InitSummaryInfo();
        }
    }
    private void InitSummaryInfo()
    {
        var accountDetail = sv.GetAccountDetail(int.Parse(Session["AccountID"].ToString()));
        lblFullnameRight.Text = accountDetail.FullName;
        lblBalance.Text = accountDetail.Balance.ToString("0,000");
        lblEmail.Text = accountDetail.Email;
        if (accountDetail.Active == 0)
        {
            lblStatus.Text = "Ngừng hoạt động";
        }
        else
        {
            lblStatus.Text = "Hoạt động";
        }
    }
}
